<?php

declare(strict_types=1);

namespace app\common\model\crm;

use think\Model;
use think\model\concern\SoftDelete;
use app\common\traits\ModelTrait;

/**
 * 客户表 - 模型
 * @author 吕玉冰
 * @date  2022-07-21
 * @copyright ©2022 泉州市盛筑信息科技有限公司 版权所有
 */
class CrmCustomer extends Model
{
    use SoftDelete;

    //软删除时间
    protected $deleteTime = 'delete_time';

    //开启自动写入时间戳字段
    protected $autoWriteTimestamp = true;
    protected $createTime = 'create_time';
    protected $updateTime = 'update_time';

    // 设置字段信息(避免多一次查询的开销)
    protected $schema = [
        'id' => 'int',
        'parent_id' => 'int',
        'contract_status' => 'tinyint',
        'name' => 'varchar',
        'subname' => 'varchar',
        'level' => 'tinyint',
        'belong' => 'varchar',
        'source' => 'varchar',
        'follow' => 'varchar',
        'next_time' => 'datetime',
        'last_time' => 'datetime',
        'receivetime' => 'int',
        'address' => 'varchar',
        'address_detail' => 'varchar',
        'location' => 'varchar',
        'lng' => 'double',
        'lat' => 'double',
        'remarks' => 'varchar',
        'create_user_id' => 'int',
        'create_user_name' => 'varchar',
        'owner_user_id' => 'int',
        'owner_user_name' => 'varchar',
        'state' => 'tinyint',
        'create_time' => 'int',
        'update_time' => 'int',
        'delete_time' => 'int'
    ];


    use ModelTrait;
}

